package com.green_reading.mandolin;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.Path;
import retrofit2.http.Query;


public class SimpleService {
    public static String BASE_URL = "http://p2p0.reconova.com:5055";

    public static class UserInfo {
        public final String name;
        public final String nikename;
        public final String logo;
        public UserInfo(String name, String nikename, String logo) {
            this.name = name;
            this.nikename = nikename;
            this.logo = logo;
        }
    }

    public interface ServerAPI {
        @FormUrlEncoded
        @POST("login")
        Call<ResponseBody> login(@Field("name") String name, @Field("password") String password);


        @FormUrlEncoded
        @POST("register_user")
        Call<ResponseBody> register_user(@Field("name") String name,
                                         @Field("password") String password,
                                         @Field("nickname") String nickname,
                                         @Field("phone") String phone);

        @GET("/get_contacts")
        Call<ResponseBody> get_contacts(@Query("user_name") String user_name);
    }
}